/*
 * @Description: 
 * @Autor: 商晓彬
 * @Date: 2021-07-06 15:43:08
 * @LastEditors: 商晓彬
 * @LastEditTime: 2022-01-04 14:37:49
 */
import { LazyLoadEvent } from 'primeng/api';
import { Component, Injector ,ViewChild } from '@angular/core';
import { AppComponentBase } from '@shared/common/app-component-base';
import { Table } from 'primeng/components/table/table';
// import { TimeUpdateComponent } from './time-update/time-update.component'
// 查看履历
// import { ShowResumeComponent } from './show-resume/show-resume.component'
import { ClassSettingServiceProxy } from '@shared/service-proxies/service-proxies';
import { finalize } from 'rxjs/operators';
import { MessageService } from '@abp/message/message.service';

@Component({
  selector: 'app-class-setting',
  templateUrl: './class-setting.component.html',
  styleUrls: ['./class-setting.component.less']
})
export class ClassSettingComponent extends AppComponentBase {
    // @ViewChild('timeUpdate')timeUpdate:TimeUpdateComponent
    @ViewChild('dataTable') dataTable: Table;
    // @ViewChild('showResume') ShowResume: ShowResumeComponent;
    isUsed:any;
    table:[];
    isUsedOptions = [
        {
            label: '中班',
            value: 1
        }, {
            label: '早班',
            value: 0
        },{
            label: '晚班',
            value: 2
        }
    ];
    constructor(
        injector: Injector,
        private _classSettingServiceProxy: ClassSettingServiceProxy,
        private _messageService: MessageService,
    ) {
        super(injector);
   }

    ngOnInit() {
    }
    getTableList(event?:LazyLoadEvent) {
        this.table=[];
        // this._classSettingServiceProxy.getClassSettingList(
        //     this.isUsed,
        // ).pipe(finalize(() => this.primengTableHelper.hideLoadingIndicator())).subscribe(result => {
        //     this.primengTableHelper.records = result;
        //     this.primengTableHelper.hideLoadingIndicator();
        // });
        this._classSettingServiceProxy.getClassSettingList(
            this.isUsed,

        )
            .pipe(finalize(() => { })).subscribe(result => {
                this.primengTableHelper.records=result;
            })
    }
    look(row) {
    // //履历
    // this.rowdata = row;
    // setTimeout(() => {
    //     this.ShowResume.show()
    //     this.ShowResume.getTableList()
    //     }, 20)
    }
    //重置
    reset() {
        // this.workArrangement = undefined;
        // this.calendarName = undefined;
    }
    //新增
    addOrUpdate(row?: any) {
        // this.rowdata = row;
        // this.title = '修改编码规则'
        // this.timeUpdate.show();
    }
}
